package cn.jiedanba.cacert.common.mapperflex.ext.genId;

public class IdWorker {

	private static Sequence seq;

	public static long getId() {
		if (seq == null) {
			seq = new Sequence();
		}
		return seq.nextId();
	}

	public static String getIdStr() {
		return String.valueOf(getId());
	}

	public static void init(long workerId, long dataCenterId) {
		seq = new Sequence(workerId, dataCenterId);
	}
}
